<template>
  <a-input-password v-model="pswd" placeholder="请输入新密码，密码包含数字字母8个字符以上" />
</template>

<script lang="ts">
import { Mixins, Component, Watch, Vue, Prop } from 'vue-property-decorator'
import { State, Mutation, Getter, namespace } from 'vuex-class'
import CustomForm from '@/components/src/Form'

@Component({
  components: {
    CustomForm
  }
})
export default class AdminList extends Vue {
  @Prop({
    type: String
  })
  public currentAreaId!: string

  public pswd = ''

  public getPassword() {
    if (!this.pswd) {
      this.$message.error('请输入密码');
      return
    }
    if (this.pswd.length < 8) {
      this.$message.error('密码长度不足8位');
      return
    }
    if (!/^(?=.*[a-zA-Z])(?=.*\d).+$/.test(this.pswd)) {
      this.$message.error('密码需要包含数字字母');
      return
    }
    return this.pswd;
  }
}
</script>

<style scoped lang="less">
.action-button {
  margin: 0px 10px 0px 10px;
}
.upload-button {
  position: relative;
  input {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    z-index: 2;
    opacity: 0;
  }
}
.form-item-class {
  margin-bottom: 0px;
}
.img-box {
  width: 100px;
  height: 100px;
  margin: 10px;
}
.item-blue {
  color: #1989fa;
}
</style>
